angular.module("app").factory("httpInterceptor", function($q, $injector,$location) { 
    var httpInterceptor = {
    		responseError : function(response) {
    			if (response.status == 403) {
    				if(response.headers()["webapp.hehe.retcode"] == "NO_SESSION"){
    					$location.path("/user/signin");
    				}    				
    			}
    			return response;
    		}
    } 
    return httpInterceptor;
});

angular.module("app").config(function($httpProvider) {
	$httpProvider.interceptors.push("httpInterceptor"); 
});